package com.tmz.cloudmall.cloudmallcoupon.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.tmz.cloudmall.cloudmallcoupon.mapper.CouponCategoryRelationMapper;
import com.tmz.cloudmall.cloudmallcoupon.domain.CouponCategoryRelation;
import com.tmz.cloudmall.cloudmallcoupon.service.ICouponCategoryRelationService;

/**
 * 优惠券分类关联Service业务层处理
 * 
 * @author tmz
 * @date 2025-08-16
 */
@Service
public class CouponCategoryRelationServiceImpl implements ICouponCategoryRelationService 
{
    @Autowired
    private CouponCategoryRelationMapper couponCategoryRelationMapper;

    /**
     * 查询优惠券分类关联
     * 
     * @param id 优惠券分类关联主键
     * @return 优惠券分类关联
     */
    @Override
    public CouponCategoryRelation selectCouponCategoryRelationById(Long id)
    {
        return couponCategoryRelationMapper.selectCouponCategoryRelationById(id);
    }

    /**
     * 查询优惠券分类关联列表
     * 
     * @param couponCategoryRelation 优惠券分类关联
     * @return 优惠券分类关联
     */
    @Override
    public List<CouponCategoryRelation> selectCouponCategoryRelationList(CouponCategoryRelation couponCategoryRelation)
    {
        return couponCategoryRelationMapper.selectCouponCategoryRelationList(couponCategoryRelation);
    }

    /**
     * 新增优惠券分类关联
     * 
     * @param couponCategoryRelation 优惠券分类关联
     * @return 结果
     */
    @Override
    public int insertCouponCategoryRelation(CouponCategoryRelation couponCategoryRelation)
    {
        return couponCategoryRelationMapper.insertCouponCategoryRelation(couponCategoryRelation);
    }

    /**
     * 修改优惠券分类关联
     * 
     * @param couponCategoryRelation 优惠券分类关联
     * @return 结果
     */
    @Override
    public int updateCouponCategoryRelation(CouponCategoryRelation couponCategoryRelation)
    {
        return couponCategoryRelationMapper.updateCouponCategoryRelation(couponCategoryRelation);
    }

    /**
     * 批量删除优惠券分类关联
     * 
     * @param ids 需要删除的优惠券分类关联主键
     * @return 结果
     */
    @Override
    public int deleteCouponCategoryRelationByIds(Long[] ids)
    {
        return couponCategoryRelationMapper.deleteCouponCategoryRelationByIds(ids);
    }

    /**
     * 删除优惠券分类关联信息
     * 
     * @param id 优惠券分类关联主键
     * @return 结果
     */
    @Override
    public int deleteCouponCategoryRelationById(Long id)
    {
        return couponCategoryRelationMapper.deleteCouponCategoryRelationById(id);
    }
}
